home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Technical Documentation / ABS Technical Notes / AWS / Third party notes / Oracle Docs / Oracle for A⁄UX Admin next >
Encoding:
Text File  |  1993-11-23  |  47.5 KB  |  1,061 lines  |  [TEXT/EDIT]

  1. Tips for administrating and supporting ORACLE7 for A/UX                Desktop
  2. Victor Grigorieff                                
  3. September 29, 1993                                            Apple A/UX 3.0.1
  4.  
  5. Revised: 10/28 by Victor Grigorieff
  6.  
  7. This bulletin explains many of the tools and procedures used in setting up,
  8. administrating, and supporting ORACLE7 on A/UX 3.0.1.  It is helpful to gather
  9. the pieces of information mentioned in this bulletin before trying other
  10. methods of diagnosing problems.
  11.  
  12. This bulletin describes several UNIX commands, but does not provide complete
  13. definitions of them.  Please refer to the documentation from Apple
  14. Computer Inc, or the manual pages on-line for complete definitions of the
  15. commands described below.
  16.  
  17. Manual pages is an option which can be chosen at the time you install the
  18. A/UX operating system.  If they are installed, you can access the information
  19. with the command called man.  
  20.  
  21. Type 'man man' for a description of the man command.
  22.  
  23. Note:  for clarity, some commands are inclosed in single quotes (') with the
  24.        arguments they accept.
  25.  
  26. The commands and configuration files of imporetance are listed below, and
  27. are grouped by the type of task to which they are related.
  28.  
  29. Macintosh Environment & A/UX Management
  30. ---------------------------------------
  31.  
  32. If you are logged into the console of A/UX 3.0.1 in the Macintosh Finder
  33. environment, you there are several things which you need to know.
  34.  
  35. Command-Control-E  If the Macintosh ever appears to freeze (You cannot type or
  36.                    move the mouse), DO NOT RESTART THE MACHINE.  You can kill
  37.                    the Macintosh session by holding down Command-Control-E.
  38.                    The Command key is the key which looks like an Apple or a
  39.                    clover.  Doing this will return you to the A/UX login
  40.                    screen, but will not affect any other UNIX processes on the
  41.                    machine, like the Oracle database.
  42.  
  43. General Controls   Under the Apple menu, there is an option for Control Panels.
  44.                    In the Control Panels folder is a General Controls Control
  45.                    Panel, which will let you set the date and time on the A/UX
  46.                    machine.  
  47.  
  48. TextEditor         If you need to edit a text file, and prefer the Macintosh
  49.                    interface, you can look in /: Applications for the program
  50.                    called TextEditor.  It works like any other word processor
  51.                    on the Macintosh.
  52.  
  53. /etc/RELEASE_ID   - This text file tells you the version of A/UX you are
  54.                     running. A/UX 3.0.1 is required for ORACLE7 Server 
  55.                     for A/UX.
  56.                     
  57.                     Type the command 'cat /etc/RELEASE_ID' to list the file:
  58.  
  59.                     cat /etc/hosts 
  60.                     **********************************
  61.                     * A/UX 3.0.1                     *
  62.                     * Friday, April 9, 1993          *
  63.                     **********************************
  64.  
  65. User Management
  66. ---------------
  67.  
  68. id          displays user and group IDs and names
  69.             If you are logged in as the oracle user, you will get output like
  70.             this:
  71.  
  72.             % id
  73.             uid=1000(oracle) gid=1000(dba)
  74.  
  75.             This means that you are the oracle user, and your active group is
  76.             dba.  By default, the oracle user and dba group own the oracle
  77.             database installation, meaning that this user can perform
  78.             privileged operations. You must have dba privileges to connect
  79.             internal, and to startup or shutdown a database. 
  80.  
  81. passwd      passwd is the command to change the password for a user account.
  82.             If I am logged in as oracle, and type 'passwd oracle', I will be
  83.             asked for the current password (if there is one), and will then be
  84.             allowed to enter a new password.  
  85.  
  86.             By default the oracle and root users have no password, so it is
  87.             important to set passwords for those users.
  88.  
  89. su          su is the command to become another user.  
  90.  
  91.             su - oracle
  92.  
  93.             This command prompts you for a password, and then logs you in as 
  94.             the oracle user, while reading in the oracle user's environment.
  95.             If you leave out the '-' between the su command and the user, you
  96.             will not read in that user's environment propoerly.  If you are
  97.             logged in as some other user, and wish to login as the oracle
  98.             user, use the above command.
  99.  
  100.             You usually become the oracle user when you want to start/stop the
  101.             database, and perform routine maintenance.
  102.  
  103. Network Management
  104. ------------------
  105.  
  106. hostname -  displays the name of the UNIX host.  This is helpful in figuring
  107.             out how to assemble a sql*net connect string for TCP/IP.
  108.  
  109.             % hostname
  110.             squid
  111.  
  112.             In this case, my hostname is 'squid'.  
  113.  
  114. ping        ping is a command which sends simple TCP/IP packets to a host to
  115.             determine whether or not the host is functioning on the network.
  116.             If you are having trouble connecting to a host with telnet or
  117.             SQL*Net TCP/IP (ORA-6108 errors), then you should check to see if
  118.             ping can reach the host.  
  119.  
  120.             ** Ping is used to check how the host is responding to TCP/IP
  121.             ** packects, which are completely different than Appletalk
  122.             ** packets.  If a client Macintosh can access the server using
  123.             ** File Sharing, then that means that the network is physically
  124.             ** intact.  It DOES NOT tell you that TCP/IP is functioning
  125.             ** properly.  You should use ping to verify the TCP/IP setup.
  126.  
  127.             ping can be run by typing '/usr/etc/ping some_host' where
  128.             some_host is the name (or IP address) of a machine on the network.
  129.             See the description of the /etc/hosts file below for more info.
  130.   
  131.             /usr/etc/ping squid
  132.             PING squid.us.oracle.com: 56 data bytes
  133.             64 bytes from 139.185.81.95: icmp_seq=0. time=0. ms
  134.             64 bytes from 139.185.81.95: icmp_seq=1. time=0. ms
  135.             ----squid.us.oracle.com PING Statistics----
  136.             2 packets transmitted, 2 packets received, 0% packet loss
  137.             round-trip (ms)  min/avg/max = 0/0/0
  138.             
  139.             Since squid has been properly configured for TCP/IP and is 
  140.             running, TCP/IP packets travel to it and back with no problem.
  141.             The ping command will keep sending packets until you hit
  142.             control-C,  at which point it gives you the PING Statistics.
  143.  
  144.             If I attempt to ping a machine which is down,  the ping command
  145.             will keep sending packets until the host responds (which may never
  146.             happen) or until you hit Control-C.  If you do not see any lines
  147.             like  '64 bytes from...' after 10 seconds, hit control-C, and you
  148.             will have output which looks like:
  149.  
  150.             /usr/etc/ping bartman
  151.             PING bartman.us.oracle.com: 56 data bytes
  152.  
  153.             ----bartman.us.oracle.com PING Statistics----
  154.             12 packets transmitted, 0 packets received, 100% packet loss
  155.  
  156.             In this case, bartman (a UNIX machine) has been turned off, and
  157.             hence does not respond to the ping command.  The 100% packet loss
  158.             means that the host you are attempting to ping is not working, or
  159.             is actually at a different address than the one you are trying.
  160.  
  161.             If I am trying to make a database connection to bartman using a
  162.             database connect string like 'T:bartman:SAMP', I would get the
  163.             ORA-6108 error, indicating that the TCP/IP connection attempt
  164.             failed.  I could then use the ping command to find out if the
  165.             machine named bartman is functioning on the network.  If bartman
  166.             does not respond to a ping, action should be taken to revive
  167.             bartman.  In this case, I would go and turn the machine on.  
  168.  
  169.             If bartman does resond to a ping, but not a SQL*Net TCP/IP
  170.             connection attempt, then there could be several different things
  171.             going on.  
  172.  
  173.              * The SQL*Net TCP/IP version 1 listener process (orasrv) may not 
  174.                be running.  Check to see if orasrv is active on the machine,
  175.                and if the /etc/services file has the correct entry for orasrv. 
  176.             
  177.              * Turn off the server and attempt to ping the server. This may
  178.                sound like a silly thing to do, but if you ping a machine that
  179.                is turned off and it actually responds, you know that there is
  180.                another machine using the same IP address.  If this happens,
  181.                you need to talk to your network administrator to determine a
  182.                new unique address for your server.
  183.  
  184. telnet      telnet is a way to log into another machine on the network using
  185.             TCP/IP.  It is a useful debugging tool as well as a convenience.  
  186.  
  187.             telnet squid
  188.             Trying...
  189.             Connected to squid.us.oracle.com.
  190.             Escape character is '^]'.
  191.  
  192.             Apple Computer A/UX (squid)
  193.             
  194.             login:
  195.  
  196.             Once you see the login prompt, type the UNIX userid you wish to
  197.             use and hit return.  You will then be asked for a password.  Once
  198.             you have successfully entered the password, you will be working
  199.             with the remote machine you have logged into, until you type exit.
  200.  
  201. ftp         ftp is a command you can use to transfer files from one machine to
  202.             another.  If you are transferring anything other than a text file,
  203.             remember to type the command 'binary' at the 'ftp> prompt.
  204.  
  205. /etc/hosts          This file lists all the IP addresses and host names for
  206.                     all machines that the A/UX server can connect to using
  207.                     TCP/IP.  
  208.  
  209.                     127.0.0.1     loop local me localhost
  210.                     139.185.81.95 squid.us.oracle.com squid
  211.  
  212.                     In this file is the default 127.0.0.1 which is an internal
  213.                     loopback entry, and the definition for this host, which is 
  214.                     squid. 127.0.0.1 is a special address.  Any machine that
  215.                     attempts to connect to that address will connect to itself.
  216.  
  217.                     The hosts file is used when the machine needs to figure out
  218.                     the IP address of a host, when it knows the hostname.
  219.  
  220.                     If you try to telnet to a host which is not in the hosts
  221.                     file, you will see:
  222.  
  223.                     telnet does_not_exist
  224.                     does_not_exist: unknown host
  225.  
  226. /etc/services       This file should contain an entry for the SQL*Net TCP/IP
  227.                     version 1 server.  If you do not have the proper line in
  228.                     ths file, you will get the ORA-6107 error while attempting
  229.                     to use SQL*Net TCP/IP version 1. The line should look like:
  230.  
  231.                     orasrv          1525/tcp        oracle
  232.  
  233. /etc/NETADDRS       This file lists the TCP/IP network configuration for the 
  234.                     UNIX machine.  
  235.  
  236.                     ao0     139.185.81.95 139.185.81.255 255.255.255.0
  237.  
  238.                     ao0 refers to the built-in ethernet device of the server.
  239.                     139.185.81.95 is the IP address of the server.
  240.                     139.185.81.255 is the broadcast address of the server.
  241.                     255.255.255.0 is the subnet mask for the server.
  242.  
  243.                     This file is created when you run the newconfig utility.
  244.                     Checking this file can be helpful to debug TCP/IP
  245.                     connectivity problems and address conflicts.
  246.  
  247. UNIX Command Management
  248. -----------------------
  249.  
  250. man         man is a program which displays the help and documentation
  251.             available for a command.
  252.  
  253.             man <some_command>
  254.  
  255.             will show you the description of the command, one page at a time.
  256.             As you are browsing the description, you hit the space bar to
  257.             advance a page, and the return key to advance one line.
  258.  
  259. apropos     gives a listing of all commands which have a certain text string
  260.             in their description.  This is useful if you remember what a
  261.             command does, but not its name.
  262.  
  263.             For example, you know you need to reconfigure your UNIX kernel to
  264.             set up certain network services. If you forget which command
  265.             to use, type:
  266.  
  267.             apropos kernel
  268.  
  269.             It will give a listing of commands and descriptions, which have
  270.             the word 'kernel' in them.   from that list, you determine that
  271.             the command you were looking for was:
  272.  
  273.             newconfig(1M)            - generates an up-to-date kernel
  274.  
  275.             After finding a command with apropos, check the man page on the
  276.             command before executing it.  It is a good idea to be aware of all
  277.             of the options available before running a command.
  278.  
  279. more        more can be called on a file, to display the file a
  280.             screen at a time. It can also have the output of a command piped
  281.             through it to show output a screen at a time.
  282.  
  283.             ps -ef | more
  284.  
  285.             This will give you a long listing of processes, a page at a time.
  286.  
  287. | (pipe)    The '|' is the UNIX pipe operator.  It sends the output of
  288.             the first command through the second command.
  289.  
  290.             some_command | some_other_command
  291.  
  292.             some_command will not send its output to the screen, but instead,
  293.             the output will be read and processed by some_other_command.
  294.  
  295. grep -      grep is a text-searching utility that returns all lines that
  296.             contain the search condition.  
  297.  
  298.             grep <some_condition> <some_file>
  299.  
  300.             This searches <some_file> for <some_condition>, and returns all
  301.             lines that match the search criterion.
  302.  
  303.             % grep squid /etc/hosts
  304.             139.185.81.95 squid.us.oracle.com squid
  305.  
  306.             This command lists all lines in the /etc/hosts file with 'squid'
  307.             in them.  When combined with the 'hostname' command above, this is
  308.             a great way to find out what the A/UX machine's IP address is.
  309.             In this example, 139.185.81.95 is my IP address, which identifies
  310.             my machine on the TCP/IP network.
  311.  
  312. wc          wc counts characters, words, and lines in a file.  It can be very
  313.             helpful to pipe the output of another program through wc.
  314.  
  315.             ps -ef | wc
  316.             134   1339   8817
  317.  
  318.             'ps -ef' gives a long listing of all processes on the machine, and
  319.             wc tells you that there are 134 lines in that output.  This means
  320.             that there are 134 processes currently running.
  321.  
  322. head        head <some_file> displays the first 10 lines of a file.  This is
  323.             useful if you just want to peek at the beginning of a file.
  324.   
  325.             'ps -ef | head' lists the first 10 processes.
  326.  
  327. tail        tail is like head, except it returns the last 10 lines.
  328.  
  329. which       which will tell you exactly what function or executable will be 
  330.             executed, given a particular command. 
  331.  
  332.             'which cc'   (This will tell me '/bin/cc' if the C compiler is
  333.                           installed, or tell me 'cc: Command not found' if the
  334.                           C compiler is not installed.)
  335.  
  336. Process & System Management
  337. ------------------
  338.  
  339. ps -ef      gives a long listing of all processes running on the UNIX machine.
  340.             There are usually MANY processes running on a UNIX machine, so you
  341.             usually want to pipe the output through 'more' or 'grep'.
  342.  
  343.             ps -ef | more  
  344.  
  345.             This will show you all of the processes a screen at a time.  Hit
  346.             the space bar to see the next page.
  347.  
  348.             ps -ef | grep oracle 
  349.  
  350.             This will give you a full listing of all processes owned by
  351.             oracle, or with oracle in their name.
  352.  
  353.             % ps -ef | grep oracle
  354.                UID   PID  PPID  C    STIME TTY      TIME COMMAND
  355.             oracle  1520  1474  5 17:27:48 qa       0:00 ps -ef
  356.             oracle  1521  1474  2 17:27:48 qa       0:00 grep oracle
  357.             oracle 20307     1  0  Aug 20  p2       0:00 ora_pmon_SAMP
  358.             oracle 20308     1  0  Aug 20  p2       0:01 ora_dbwr_SAMP
  359.             oracle 20309     1  0  Aug 20  p2       0:05 ora_lgwr_SAMP
  360.             oracle 20310     1  0  Aug 20  p2       0:45 ora_smon_SAMP
  361.             oracle 20311     1  0  Aug 20  p2       0:00 ora_reco_SAMP
  362.             daemon  1473 21954  4 17:08:27 ?        0:26 oracleSAMP T:I,1024,5
  363.             oracle  1531  1530  0 17:34:55 qa       0:00 oracleSAMP AT:I,0,5
  364.             oracle  1474  1456  0 17:08:34 qa       0:01 -csh
  365.  
  366.             Note: I pasted the titles of the columns into this document for
  367.                   clarity. The UID is the owner of the process.  The COMMAND
  368.                   is the name of the process.
  369.      
  370.             In this example, you see that there are 5 processes with the
  371.             format ora_XXXX_SAMP.  These are the processes that make up the
  372.             ORACLE database named SAMP.  The 'oracleSAMP T:I,1024,5' process
  373.             is called a TCP/IP shadow process, and means that there is a
  374.             remote user connected to the SAMP database using SQL*Net TCP/IP.
  375.             The 'oracleSAMP AT:I,0,5' process is an Appletalk shadow process,
  376.             representing a remote connection using SQL*Net Appletalk.
  377.  
  378.             From time to time, you may have to kill these shadow processes.
  379.             'ps -ef | grep oracle' will help you find them.
  380.  
  381. kill        kill can be used to terminate a process that is no longer needed 
  382.             on your machine.  
  383.  
  384.             kill <PID> 
  385.  
  386.             where PID is the process ID of the process you wish to terminate.
  387.             The PID can be determined by looking at the second column of the
  388.             ps -ef listing explained above.
  389.  
  390.             For example, as part of the 'ps -ef' listing, I see:
  391.  
  392.             daemon  1473 21954  4 17:08:27 ?        0:26 oracleSAMP T:I,1024,5
  393.  
  394.             If I know that no one is connected to the SAMP database using
  395.             TCP/IP, I can kill the orphaned shadow process with the command:
  396.  
  397.             kill 1473
  398.  
  399.             Then the process will be dead, and the database will clean up
  400.             after the connection.  If the process does not die, you can use
  401.             'kill -9 <PID>' instead, which will definitely kill the process.
  402.  
  403. &           The ampersand character, when added onto any other command, will
  404.             run the program in the background, which means that you could run
  405.             another command in the current window.
  406.  
  407.             atksrv Squid
  408.  
  409.             would normally just run the program, and you could not type any
  410.             other commands (except control-c to stop the program).
  411.  
  412.             atksrv Squid &
  413.  
  414.             runs the same command in the background, meaning that you can run
  415.             other programs.
  416.  
  417. jobs        lists the jobs which are currently in the background.
  418.  
  419.             jobs
  420.             [1]  + Running                atksrv MyServer
  421.  
  422. %           This command is used to bring a bring a background process to the
  423.             foreground.     In the above example, there was a background process
  424.             called 'atksrv MyServer'.  Typing % at the prompt would bring the
  425.             'atksrv MyServer' process back to the foreground.
  426.  
  427.             If there are multiple processes in the background, you can use
  428.             '%2' to bring the second process in the list to the foreground.
  429.  
  430. pstat -m    pstat -m lists current system status, including the amount of
  431.             physical memory which is currently free.
  432.  
  433. uptime      uptime tells you how long the UNIX machine has been running, and 
  434.             what the current load average is on the machine.  It also tells
  435.             you the current time, which lets you know if you need to reset the
  436.             clock on your server.
  437.  
  438.             uptime
  439.             7:28am  up 54 days, 13:59,  19 users,  load average: 2.29 2.32 2.20
  440.  
  441.             The load average tells you how many processes are actively using
  442.             the processor.  At the time I ran this command, there were 130
  443.             processes on the machine, but only two of them were active.  If I
  444.             have 5 remote macintosh clients actively start using one of the
  445.             databases, the 5 shadow processes would become active, and the
  446.             load would jump from about 2 to about 7.
  447.  
  448. ipcs -a     ipcs -m lists the status of all attatched blocks of shared memory.
  449.             An Oracle database uses a block of shared memory to store the SGA
  450.             (Shared Global Area).  
  451.  
  452.             ipcs -m
  453.             IPC status from /dev/kmem as of Wed Sep 15 07:35:18 1993
  454.             T     ID     KEY        MODE       OWNER    GROUP
  455.             Shared Memory:
  456.             m   2100 0x744c4f57 --rw-------     root     root
  457.             m   1501 0x00028d92 --rw-r-----   oracle      dba
  458.             m    402 0x00020386 --rw-r-----   oracle      dba
  459.             m    203 0x00025a8e --rw-r-----   oracle      dba
  460.             m    404 0x0002c003 --rw-r-----   oracle      dba
  461.             m    605 0x0002f58f --rw-r-----   oracle      dba
  462.  
  463.             The first entry is owned by root, with the root group.  This
  464.             segment is used by the UNIX kernel, and is OK.
  465.  
  466.             Note:  the order of the entries in this list does not matter.
  467.  
  468.             The other 5 segments here are blocks which were obtained by Oracle
  469.             databases on the machine.  I know this because the owner is oracle
  470.             and the group is dba.  I can then determine which Oracle databases
  471.             are running by looking for processes with the letters 'dbwr' in
  472.             the name, as that is a process which is required by the rdbms.
  473.  
  474.             ps -ef | grep dbwr
  475.             root   10355 10242  2 07:39:46 pb       0:00 grep dbwr
  476.             oracle  4196     1  0  Sep  2  ?        0:02 ora_dbwr_S6A
  477.             oracle  5856     1  0  Sep  8  ?        0:02 ora_dbwr_S6C
  478.             oracle  4211     1  0  Sep  2  ?        0:02 ora_dbwr_S6B
  479.             oracle  4232     1  0  Sep  2  q4       0:02 ora_dbwr_SAMP
  480.  
  481.             Looking at the right column, I see 4 processes with the name
  482.             ora_dbwr_???, where ??? is the name of the database (SID).  The
  483.             databases S6A,S6B,S6C, and SAMP are active on this machine.  
  484.  
  485.             I have 4 running datbases, and 5 segments of shared memory
  486.             attatched by Oracle databases.  This generally means that a
  487.             database was terminated abnormally (by killing the processes or a
  488.             severe crash).  That last block of shared memory will not be freed
  489.             until the system is rebooted.  
  490.  
  491.             In situations where you have blocks of shared memory that were not
  492.             freed, you should reboot the system as soon as you can.
  493.  
  494. File Management
  495. ---------------
  496.  
  497. ls          ls gives a listing of the files in the current directory.
  498.  
  499.             ls -lF gives a useful long listing, and places a '/' after the
  500.             name of each directory, and a '*' after each executable program.
  501.  
  502.             ls -a lists all files, including files that begin with the "."
  503.  
  504. cd          cd changes the current directory.
  505.             
  506.             'cd /' changes the active directory to the root of the filesystem.
  507.              
  508.             'cd ..' changes to the parent directory of the current directory.
  509.  
  510. pwd         pwd tells you what directory you are accessing.  
  511.  
  512. mkdir       'mkdir new_directory' makes a new directory called 'new_directory'
  513.  
  514. cp          cp is the command to copy a file to a new file.  
  515.  
  516.             'cp -r' is a recursive copy, which can copy directories and their
  517.             contents.
  518.  
  519. mv          mv is the command to move or rename a file.  mv is not capable of
  520.             moving a file from one filesystem to another.
  521.  
  522. chmod       chmod <new permissions> <some_file> changes the permission bits on
  523.             a file.  chmod is often used to either restrict access to a file,
  524.             or to enable the 'setuid bit' on an executable program.
  525.  
  526.             A file has certain permission bits, which determine the rights to
  527.             read, write, and execute the file.  These permissions are given
  528.             differently to the owner of the file, the group to which the file
  529.             belongs, and everyone else.
  530.  
  531.             ls -l will give a full listing of files, and the left-most column
  532.             is a listing of permission bits.
  533.  
  534.             -rwxr-xr-x   1 oracle   dba      4122655 Jun 19 14:19 sqldba*
  535.  
  536.             There are a total of 10 characters in the left column.
  537.  
  538.             The first character is '-' for a file, and 'd' if the item is a
  539.             directory.               
  540.  
  541.             The next 9 characters are 3 groups of 3 characters each.
  542.             Each group determines the rights to read, write, and execute.
  543.             
  544.             rwx means that read, write, and execute rights are enabled
  545.             r-x means that read and execute are enabled, but writing is not.
  546.              
  547.             If the letter is present in a particular position, the right is
  548.             enbabled.  If there is a '-', the permission is disabled.
  549.  
  550.             The first group of letters corresponds to the rights granted to
  551.             the owner of the file.  The userid listed in the third column of
  552.             the ls -l output is the owner of the file.  
  553.  
  554.               ** If the owner's permissions are 'rws', then the setuid bit is
  555.               ** set, meaning that the program will run with all of the rights
  556.               ** as the owner of the program, regardless of who invokes the 
  557.               ** program.
  558.  
  559.             The second group of letters corresponds to the rights of the group
  560.             to which the file corresponds, which is the fourth parameter of
  561.             the ls -l output.
  562.             
  563.             The third group of letters defines the permissions for everybody.
  564.  
  565.             -rwxr-xr-x means that everyone can read and execute the file, but 
  566.                        only the owner can write (modify) it.  
  567.  
  568.             -rwsr-x--- means that the setuid bit is enabled, people in the 
  569.                        group which owns the file may read and execute the file,
  570.                        but people outside of the group have no access to the 
  571.                        program. 
  572.  
  573.             To set the permissions, you need to assemble a string of 3 numbers
  574.             to tell chmod how to set the permissions. Different priviledges
  575.             are enabled by adding up the numbers below:
  576.  
  577.             read -    4
  578.             write -   2            
  579.             execute - 1
  580.             
  581.             read and execute priviledges (4 + 1) are 5
  582.             read, write, and execute (4 + 2 + 1) are 7
  583.             to set the setuid bit, you prefix your string with the number 4.
  584.  
  585.             chmod  755  (yields -rwxr-xr-x)
  586.             chmod  400  (yields -r--------)
  587.             chmod 4755  (yields -rwsr-xr-x)  (The setuid bit is enabled)
  588.  
  589.             The files 'orasrv' and 'oracle' (which are located in the
  590.             /users/oracle/bin) should be -rwsr-xr-x.  You can set these
  591.             permissions with the command:
  592.   
  593.             chmod 4755 orasrv oracle
  594.  
  595. chown       chown <new_owner> <some_file> changes the ownership of <some_file>
  596.             to be owned by <new_owner>.  Only the current owner or the
  597.             superuser (root) may issue this command.
  598.  
  599.             Only the owner and the superuser (root) may delete a file.  
  600.             the ownership of a file is usually most important with executable
  601.             files that have the setuid bit set (see chmod above).
  602.  
  603.             *** Note:  when you change the ownership of a file, the permission
  604.             ***        bits can be changed.  You may need to use the chmod
  605.             ***        command to get the proper setting.
  606.  
  607. chgrp       chgrp <new_group> <some_file> changes the group ownership of
  608.             <some_file> to be owned by <new_group>.  Only the current owner or
  609.             the superuser (root) may issue this command.
  610.  
  611. find        find can be used to locate files, and perform an action on each of
  612.             them if desired.
  613.  
  614.             find . -exec ls -l {}\;
  615.            
  616.             This command looks a bit confusing, but it gives a long listing of
  617.             the files in the current directory, as well as all of the
  618.             subdirectories.  Check the manual pages on find for more detailed
  619.             information.  
  620.  
  621. tar         tar creates archives and extracts data from them.
  622.  
  623.             tar -cf archive.tar something 
  624.               (creates a new archive called 'archive.tar' containing a copy 
  625.                of 'something'.  Something could be a file, or a filesystem)
  626.  
  627.             ** Note: NEVER try to back up a database that is RUNNING.
  628.             **       copies of running databases WILL NOT WORK.
  629.  
  630.             tar -xf archive.tar
  631.               (extracts the contents of archive.tar into the current directory)
  632.  
  633. compress    'compress some_file' will create a compressed version of the file
  634.             called some_file.Z, and deletes some_file.  You must uncompress
  635.             the some_file.Z before using it again.
  636.  
  637. Filesystem Management
  638. ---------------------
  639.  
  640. If you are not familiar with filesystems, mounting of filesystems, or disk
  641. setup in general on A/UX 3.0.1, please refer to the "Disk Setup" section of 
  642. Bulletin #103947.028 -- "Setting up an AWS 95 Server for ORACLE7 for A/UX".
  643.  
  644. df -B       df will give you a line of information for each of the mounted
  645.             filesystems.  Note the captital letter 'B', which specifies that
  646.             the results should be given in kilobytes.
  647.             
  648.             df -B
  649.             Filesystem        kbytes    used   avail %used  Mounted on
  650.             /dev/dsk/c0d0s0   140519  125637    7856   94%  /
  651.             /dev/dsk/c300d0s  637015  523524   81640   87%  /u1
  652.             /dev/dsk/c401d0s 1122889  805559  261185   76%  /u2
  653.  
  654.             This command tells you which filesystems were successfully
  655.             mounted, where they are mounted, how big they are, and how much
  656.             space is available on each of them.
  657.  
  658.             ** Notice that the 'Filesystem' column is not giving you the first
  659.             ** 16 letters in the name of the disk device file.  If you need
  660.             ** the full name, check the /etc/fstab file, or use the df command
  661.             ** without the -B flag.
  662.  
  663. /etc/fstab  the fstab file has one line for each filesystem which should be
  664.             mounted.  It specifies the type of filesystem, where to mount it,
  665.             and on what device it resides.
  666.  
  667.             # fstab for Squid 6/23/93
  668.             #
  669.             /dev/dsk/c300d0s0       /       ignore  rw      1 0
  670.             /dev/dsk/c300d0s2       /u1     4.2     rw      1 0
  671.             /dev/dsk/c401d0s2       /u2     4.2     rw      1 0
  672.  
  673.             The lines that begin with # are ignored.  It is a good idea to put
  674.             notes in this file that identify which machine it belongs to, and
  675.             when it was last modified.  Whenever you modify this file, you
  676.             should PRINT it and put it somewhere safe.  
  677.  
  678.           *** IMPORTANT:  having a printout of the fstab file is very helpful
  679.           ***             if your machine has a damaged root partition, and 
  680.           ***             you need to remember where all of your filesystems
  681.           ***             reside.  You need to know the location of your root
  682.           ***             filesystem.  /dev/dsk/c300d0s0 is the default, but
  683.           ***             it may be different on your system.
  684.  
  685.           ***  I like to tape a printout of this file to the machine.
  686.  
  687. fsck        fsck checks filesystem consistency and interactively repairs the 
  688.             filesystem.  If a filesystem will not mount, you need to run fsck
  689.             on it to verify and fix it.  fsck works on a disk device file that
  690.             corresponds to the filesystem in question.  If the filesystem
  691.             which normally mounts fine on u1 is not mounting, I need to run
  692.             fsck.  I can't just run 'fsck u1'.  I need to run fsck on the disk
  693.             device file that was listed in the /etc/fstab file that
  694.             corresponds to the problematic filesystem.
  695.  
  696.             squid.root # fsck /dev/dsk/c300d0s2
  697.             ** /dev/dsk/c300d0s2
  698.             ** Last Mounted on /u1
  699.             ** Phase 1 - Check Blocks and Sizes
  700.             ** Phase 2 - Check Pathnames
  701.             ** Phase 3 - Check Connectivity
  702.             ** Phase 4 - Check Reference Counts
  703.             ** Phase 5 - Check Cyl groups
  704.             FILE SYSTEM STATE IS MARKED AS DIRTY
  705.             FIX? 
  706.  
  707.             When you find out "FILE SYSTEM STATE IS MARKED AS DIRTY", you do
  708.             NOT ALWAYS want to fix that.  
  709.  
  710.                ** If the filesystem is currently mounted ( it shows up when
  711.                   you use the df command), it will be DIRTY, which is OK.
  712.                   Filesystems are dirty when there is data in buffers that has
  713.                   not been written out to disk, which is fine if the
  714.                   filesystem is mounted and in use.  If this is the case,
  715.                   choose N. 
  716.  
  717.                ** If the filesystem is not mounted (it does not show up when
  718.                   you use the df command) then you should choose Y.
  719.  
  720.             If an Oracle database (or some other program) is writing to a
  721.             file on a filesystem at the time a server goes down (crashes),
  722.             then the filesystem will not mount when the server comes back up.
  723.             You need to run fsck to repair the dirty filesystem.
  724.  
  725.             If the dirty filesystem is the root (/) filesystem, then A/UX will
  726.             not boot.  The A/UX Startup program will tell you that the
  727.             root filesystem (/dev/dsk/c0d0s0) is dirty, and will present you
  728.             with a window in which you can issue some UNIX commands.  Try:
  729.  
  730.             fsck /dev/dsk/c300d0s0  
  731.  
  732.             Once fsck completes the repairs on the filesystem, you should be
  733.             able to type the command 'boot' to start A/UX.
  734.  
  735. mount -a    mount -a will attempt to mount every filesystem listed in the
  736.             /etc/fstab file.  If mount -a returns no information, that means
  737.             that it had no problem.  If it gives you errors, that means that
  738.             either the /etc/fstab file is not set up properly, or the
  739.             filesystem is damaged and should be checked with fsck.
  740.  
  741.             mount -a is automatically called at startup time.  You should only
  742.             need to use this command after modifying the /etc/fstab file or
  743.             after repairing a filesystem with fsck.
  744.  
  745. Unix Shells:
  746. -----------
  747.  
  748. .login      The .login file is in the home directory of each user.  The .login
  749.             file contains commands which are executed automatically when the
  750.             user logs in to the UNIX machine.
  751.  
  752.             It is often helpful to set the following in the .login file:
  753.  
  754.             setenv ORACLE_HOME /users/oracle
  755.             setenv ORACLE_SID  SAMP
  756.             setenv PATH        "/users/oracle/bin:/bin:/usr/bin:/usr/ucb:
  757.                                /mac/bin:/etc:/usr/etc:/usr/local/bin"
  758.  
  759.             Adding these lines to the .login file will set these variables
  760.             automatically when you next login, or use the source command.
  761.  
  762. PATH        PATH is the environment variable which lists the directories on the
  763.             UNIX machine that will be searched when a command is typed. 
  764.             If I type 'do_something', and there is no program called
  765.             'do_something' in the current directory, the shell will search all
  766.             the directories listed in the PATH for an executable program
  767.             called 'do_something'.  A default PATH may look like:
  768.  
  769.             PATH=:/bin:/usr/bin:/usr/ucb:/mac/bin:/etc:/usr/etc:/usr/local/bin
  770.  
  771.             If you try to use the oracle program called 'sqldba' you will see:
  772.  
  773.             sqldba
  774.             sqldba: Command not found.
  775.  
  776.             If you want to be able to use Oracle commands, you should add the
  777.             bin directory of the oracle home to the PATH.  This is
  778.             '/users/oracle/bin' by default.  Then the PATH would look like:
  779.  
  780.             PATH=:/bin:/usr/bin:/usr/ucb:/mac/bin:/etc:/usr/etc:/usr/local/bin:
  781.                   /users/oracle/bin
  782.  
  783.             In this case, the PATH references /users/oracle/bin, so the sqldba
  784.             command can be used without problem.
  785.  
  786. csh         csh is the C shell, which is the default shell for each user
  787.             except root.  Use the setenv command to set environment variables.
  788.             when running the C shell.  This is also known as /bin/csh.
  789.  
  790. setenv      setenv sets environment variables under csh.
  791.             
  792.             'setenv SOME_VARIABLE some_contents' sets the variable 
  793.             SOME_VARIABLE to be some_contents.
  794.            
  795.             There are 3 environment variables which are important under A/UX.
  796.             They are ORACLE_HOME, ORACLE_SID, and PATH.
  797.  
  798.             ORACLE_HOME = /users/oracle ( This is the directory where the
  799.                                           oracle files and executables reside )
  800.             ORACLE_SID  = SAMP          ( This is the name of the default
  801.                                           database, which is SAMP )
  802.             PATH = ../users/oracle/bin.. ( discussed in PATH section above )
  803.               
  804. sh          sh is the Bourne shell, which is the default user for the root
  805.             user.  This is also known as /bin/sh.
  806.  
  807.             To set an environment variable in the Bourne shell, you can do:
  808.  
  809.             SOME_VARIABLE=some_contents; export SOME_VARIABLE
  810.  
  811.             It is important to add the '; export SOME_VARIABLE' to the line,
  812.             as otherwise programs that you run will not be able to evaluate
  813.             that environment variable.
  814.  
  815.             ORACLE_SID=SAMP; export SAMP
  816.  
  817.             This sets the ORACLE_SID to be SAMP, and allows other programs you
  818.             run (like Oracle utilities) to read the variable.
  819.  
  820. env         env lists the names and contents of all variables in the current
  821.             shell's environment.  
  822.  
  823. source      source is used to read in a configuration file.  If you edit the
  824.             .login file, and want the changes to take effect, you can log out
  825.             and log in again, or read in the file.  To read in the .login:
  826.  
  827.             source .login
  828.  
  829.             This will run all of the commands in the .login file.
  830.  
  831. Oracle Database Management
  832. --------------------------
  833.  
  834. tcpctl      tcpctl is a command to help you start, stop, and get the status of
  835.             the SQL*Net TCP/IP version 1 listener.  
  836.  
  837.        **   'tcpctl status' should give you the status of orasrv.
  838.  
  839.             tcpctl status
  840.             tcputl: Status summary follows
  841.             Server is running:
  842.               Started             : 8-SEP-93 12:08:51
  843.               Last connection     : 15-SEP-93 11:09:17
  844.               Total connections   : 87
  845.               Total rejections    : 3
  846.               Active subprocesses : 9
  847.               ORACLE SIDs         : S6A,S6B,S6C,S7F,SAMP
  848.               Default SID         : (null)
  849.             Logging mode is ENABLED.
  850.             DBA logins are DISABLED.
  851.             OPS$ logins are ENABLED.
  852.             OPS$ROOT logins are DISABLED.
  853.             Orasrv is detached from the terminal.
  854.             Break mode = IN BAND.
  855.             Debug level = 1
  856.             No timeout (on orasrv handshaking).
  857.             Length of listen queue = 10
  858.             Orasrv logfile = /u2/7012f/tcp/log/orasrv.log
  859.             Orasrv mapfile = /etc/oratab
  860.  
  861.             This tells you that the server is running, and has been running
  862.             for a week.  It has serviced 87 connections since it was started,
  863.             and there are currently 9 connections made to the server.
  864.             The active SIDs were read in from the /etc/oratab file.
  865.  
  866.             If the server is not running, it will look like:
  867.  
  868.             tcpctl status
  869.             tcputl: server is not running: Connection refused
  870.             
  871.        **   'tcpctl start' should start the TCP/IP listener process (orasrv).
  872.            
  873.             tcpctl start
  874.             tcpctl: log file is /u2/7012f/tcp/log/orasrv.log
  875.             tcpctl: SID mapping file is /etc/oratab
  876.             tcpctl: server will be run under oracle
  877.             tcpctl: logging mode is on
  878.  
  879.             orasrv: Release 1.2.7.5.1 - Production on Wed Sep 15 12:01:06 1993
  880.  
  881.             Copyright (c) Oracle Corporation 1979, 1993.  All rights reserved.
  882.  
  883.             Starting server on port 1525.
  884.             tcpctl: server has been started
  885.  
  886.             This means that server was succesfully started on port 1525 (which
  887.             was read in from the /orasrv entry of the etc/services file).
  888.  
  889.             You may get the following error if you try to issue the 'tcpctl
  890.             start' immediately after issuing a 'tcpctl stop':
  891.  
  892.             Starting server on port 1525.
  893.             orasrv: server already running: Address already in use
  894.  
  895.             If this happens, wait a few minutes and try again, while the UNIX
  896.             operating system releases the port.
  897.  
  898.        **   'tcpctl stop'  should stop the TCP/IP listener process (orasrv).
  899.  
  900.             'tcpctl stop' requires that you log into the A/UX machine as the
  901.             user who started the server.  You must actually log into the
  902.             machine or telnet to the machine to have the proper priviledges.
  903.             If I log in as a user who is not a dba, and use the 'su - oracle'
  904.             command to become the oracle user, it will not work:
  905.  
  906.             tcpctl stop
  907.             tcputl: checking user permission...
  908.             tcputl: permission denied
  909.  
  910.             If I then telnet to this machine as oracle, or log out and log in
  911.             as oracle, it will work:
  912.  
  913.             tcpctl stop
  914.             tcputl: checking user permission...
  915.             tcputl: server has been stopped
  916.  
  917.             You can also stop the orasrv process by killing it.
  918.  
  919.             ps -ef | grep orasrv   (this finds the orasrv process...) 
  920.             oracle   692       1  0  Sep 21  ?        0:02 orasrv
  921.             vgrigori 16358 15344  2 18:17:44 p2       0:00 grep orasrv
  922.  
  923.             kill 692  (This kills the orasrv process.)
  924.             
  925. orasrv      orasrv is the SQL*Net TCP/IP version 1 listener process which is
  926.             controlled by the tcpctl program.
  927.  
  928. atksrv      atksrv is the SQL*Net Appletalk version 1 listener process.  It is
  929.             invoked with the command atksrv.
  930.  
  931.             atksrv Squid
  932.             atksrv: Release 1.0.1.2.1 - Production on Wed Sep 15 12:38:06 1993
  933.  
  934.             Copyright (c) Oracle Corporation 1979, 1993.  All rights reserved.
  935.  
  936.             Server name is Squid
  937.  
  938.             Server Squid[10790] is accepting connections....
  939.  
  940.          *  If you get the error: Cannot register service "Squid" on network,
  941.             that means that there is an appletalk listener using that name
  942.             already in your zone of the Appletalk network.
  943.  
  944.             The [10790] tells you the PID of the atksrv process.  You can stop
  945.             the atksrv listener by hitting control-C, or by killing the
  946.             process manually from another UNIX prompt.
  947.  
  948.             You could also kill the atksrv process in the same way you could
  949.             kill the orasrv process, which is described in the tcpctl section.
  950.            
  951. sqldba      sqldba is the utility used to administrate the Oracle database.  It
  952.             can create, startup, and shutdown databases. If the database is
  953.             not running, you can only connect to it by using 'connect
  954.             internal'.  Once connected internally, you may startup and
  955.             shutdown the database.
  956.  
  957.             sqldba
  958.  
  959.             SQL*DBA: Release 7.0.12.2.0 - Production on Wed Sep 15 12:44:56 
  960.  
  961.             Copyright (c) Oracle Corporation 1979, 1993.  All rights reserved. 
  962.  
  963.             ORACLE7 Server Release 7.0.12.2.0 - Production
  964.             With the procedural and distributed options
  965.             PL/SQL Release 2.0.14.0.1 
  966.            
  967.             SQLDBA> connect system/manager
  968.             ORA-01034: ORACLE not available
  969.             ORA-07318: smsget: open error when opening sgadef.dbf file.
  970.             Macintosh A/UX Error: 2: No such file or directory
  971.  
  972.             The above error occurs when the database is not running. If you
  973.             are logged in as a user in the dba group, you may connect
  974.             internally and startup the database.
  975.  
  976.             SQLDBA> connect internal
  977.             Connected.
  978.             SQLDBA> startup
  979.             ORACLE instance started.
  980.             Database mounted.
  981.             Database opened.
  982.             Total System Global Area       7319428 bytes
  983.                           Fixed Size         30492 bytes
  984.                        Variable Size       6453352 bytes
  985.                     Database Buffers        819200 bytes
  986.                         Redo Buffers         16384 bytes
  987.       
  988.             After starting up the database, you may connect as a database
  989.             user.
  990.  
  991.             SQLDBA> connect scott/tiger
  992.             Connected.
  993.  
  994.             You could then connect internally and shutdown the database.
  995.  
  996.             SQLDBA> connect internal
  997.             Connected.
  998.             SQLDBA> shutdown
  999.             Database closed.
  1000.             Database dismounted.
  1001.             ORACLE instance shut down.
  1002.  
  1003. Loopback    You could then attempt a TCP/IP connection to the database
  1004.             (provided you have started the orasrv process).  This is called a
  1005.             loopback, as the server machine is making a connection to itself,
  1006.             which is a useful test of the server's functionality.
  1007.  
  1008.             SQLDBA> connect scott/tiger@t:squid:S7F
  1009.             Connected.
  1010.  
  1011.           * You may get errors trying to do the loopback.
  1012.             
  1013.             ORA-6114 - problem with the SID you specified.  Compare the SID
  1014.                        you tried with the /etc/oratab file.
  1015.  
  1016.             ORA-6401 - you did not install SQL*Net TCP/IP.
  1017.  
  1018.             ORA-3113 - you probably did not install the C programming option
  1019.                        of A/UX and oracle was not properly installed.
  1020.       
  1021.             ORA-6107 - you need to add the orasrv entry to /etc/services.
  1022.  
  1023.             ORA-6105 - you need to add the server's hostname to /etc/hosts
  1024.  
  1025.             ORA-6108 - orasrv is not running, or you have the wrong IP 
  1026.                        address entered for your server in /etc/hosts.
  1027.                        Refer to the description of ping above.
  1028.             
  1029.             ORA-1034 - orasrv is running properly, but the rdbms is not.
  1030.                        Use sqldba to start the database.
  1031.  
  1032.             ORA-7318 - This error usually follows ORA-1034, but it means the
  1033.                        same thing.  The database is not running.
  1034.  
  1035. /etc/oratab       - This file lists the instances (SID's) available on the
  1036.                     A/UX machine.  The has one line per database on the
  1037.                     machine.  Lines beginning with '#' are comments which are 
  1038.                     ignored.  Each line is made up of the format:
  1039.  
  1040.                     SID:ORACLE_HOME:STARTUP
  1041.  
  1042.                     Where:  SID is the name of the database 
  1043.                             ORACLE_HOME is where you installed the database
  1044.                             STARTUP is either Y or N, which indicates whether
  1045.                                     the dbstart and dbshut utilities should 
  1046.                                     start or stop that database.
  1047.  
  1048.                     The default /etc/oratab should have the line:
  1049.  
  1050.                     SAMP:/users/oracle:N
  1051.                
  1052.                     This means that I have one database on my machine, it is
  1053.                     named SAMP, and the ORACLE_HOME for the SAMP database is
  1054.                     /users/oracle. The ORA-6114 error occurs if you attempt 
  1055.                     to connect to a database that is not listed in the
  1056.                     oratab file.  
  1057.                     
  1058.                     *** The capitalization of the SID is important
  1059.                     *** 'SAMP' is different from 'samp'.
  1060.  
  1061.